package com.example.chapter13;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

/*
 * 13.2.3.文本文件的数据处理-读取文本文件-使用java.io
 * */
public class TextFileReaderIo {

    public static void main(String[] args) {
        BufferedReader reader = null;
        try {
            reader = new BufferedReader(new FileReader("path/to/your/textfile.txt"));
            String line;
            while ((line = reader.readLine()) != null) {
                System.out.println(line);
            }
        } catch (
                IOException e) {
            e.printStackTrace();
        } finally {
            if (reader != null) {
                try {
                    reader.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
